<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>




    <script>
        let num = (prompt("请输入内容"));
        // console.log(isNaN (num));
        // console.log(typeof (num));
        // if (isNaN(num) == true) {
        if (isNaN(num)) {
            alert("请输入数字")
        } else {
            num = Number(num)
            if (num >= 0 && num <= 59) {
                num = 1
            } else if (num >= 60 && num <= 79) {
                num = 2
            } else if (num >= 80 && num <= 100) {
                num = 3
            }
            num = parseInt(num)
            switch (num) {
                case 1:
                    console.log("不及格");
                    alert("不及格");
                    break;
                case 2:
                    console.log("良好");
                    alert("良好");
                    break;
                case 3:
                    console.log("优秀");
                    alert("优秀");
                    break;
                default:
                    console.log("输入错误请重新输入");
                    alert("输入错误请重新输入");
                    break;
            }
        }










    </script>
</body>

</html>